<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
	<meta charset="utf-8">
    <title>Available Truck Page</title>
<?php echo link_tag(my_url().'skin.css'); ?>
<script type="text/javascript" src="<?php echo my_url(); ?>js/1.js"></script>
<script type="text/javascript" src="../js/1.js"></script>
<script src="<?php echo my_url(); ?>js/AC_RunActiveContent.js" type="text/javascript"></script>
<script src="<?php echo my_url(); ?>js/trhighlight.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
 var BaseURL='<?php echo base_url(); ?>';
function confirmDelete(at_id){
	
	var x= window.confirm("Are you sure to delete this item?");
	if(x){
		window.location.href = BaseURL + "at/delete_at/" + at_id;
	}	
}

</script>

<link rel="stylesheet" href="../skin.css" type="text/css" media="screen" /><meta name="author" content="Jaypee Mahilum" />
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<link href="skin.css" rel="stylesheet" type="text/css" />
</head>

<?php



//echo $_SESSION['administrator_log']."============";
if(!isset($_SESSION['administrator_log']))
{
		echo"Log in first to access this page<html><title>WARNING</title><body><br><a href='".base_url()."administrator' />click here to log in.</a></body></html>";
}
else
{
?>

<?php
if(isset($debug))
{
	echo "<h2> $debug </h2>";
	exit;
}

?>
     
<body >


	<div class="BodyCoverat1">
	 		<div class="ParentContentat1">
	        <?php require("at_menu.php"); ?>
			<div class="MenuTab">
    			<div class="MenuBelow">
                    <div class="mbg"></div>
                 </div>        
             </div>
	   <div class="title">
			   <h1>Available Truck List:</h1>
       </div>                      
			<div class="module-indexat1">
		  		<div align="right"><a href="<?php echo base_url()?>admin/logout" style="color:#FF0000;">logout</a></div>
  	                <?php if (isset($recordflag)) {echo $recordflag;}?>
                
                		 <a href="<?php echo base_url() . "at/add_at/" ?>">
         	<img src=" <?php echo my_url() ."images/icons/action_add.gif" ?>" style='border:none'/> Add New Data</a><br />
          
            <fieldset>
			<div class="at-search-wrapper">
                <div class="search_at">
            	<form action="<?php echo base_url(); ?>at/SearchDdlistsort" method="post">
					<label><b>Search</b></label>
                    <input type="text" name="search_value" id="search_value" value="" size="20" />
					
					<label><b>by:</b></label>
						<select id="column_value" name="column_value">
						
							<?php if(isset($column_value)) {?>
								<?php if ($column_value=='') {?>
									<option value="" selected='selected'></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
							
																
								<?php } if ($column_value=='load_no') {?>
									<option value=""></option>	
									<option value="load_no" selected='selected'>Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
															
								<?php } if ($column_value=='dv_company_name') {?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name" selected='selected'>Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
																								
								<?php } if ($column_value=='drop_off_city') {?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city" selected='selected'>City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
							
															
								<?php } if ($column_value=='drop_off_state') {?>	
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state" selected='selected'>State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
																							
								<?php }if ($column_value=='drop_off_date'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  selected='selected'>Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
							
																		
								<?php }if ($column_value=='type_of_truck'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck" selected='selected'>Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
						
									
								<?php }if ($column_value=='status'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date" >Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status"  selected='selected'>status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
																							
								<?php }if ($column_value=='des_state'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>	
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  >Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state" selected='selected'>Des : State</option>
									<option value="des_zone">Des : Zone</option>
						
																	
								<?php }if ($column_value=='des_zone'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  >Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone" selected='selected'>Des : Zone</option>
								
																
																
								<?php }} else {?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									
								<?php } ?>
						</select> 
					<input type="submit" value="Search" id="Search" />
				</form>
                </div>
                
                <div class="sort_at">
		            	<form action="<?php echo base_url(); ?>at/ddlistsort" method="post">
								
					<label><b>Sort by:</b></label>
						<select id="sort" name="sort">
						
							<?php if(isset($sort)) {?>
								<?php if ($sort=='') {?>
									<option value="" selected='selected'></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date and drop_off_state">Date & State</option>
									<option value="drop_off_date and des_state">Date & Des_State</option>
									<option value="drop_off_date and des_zone">Date & Des_Zone</option>
																
								<?php } if ($sort=='load_no') {?>
									<option value=""></option>	
									<option value="load_no" selected='selected'>Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
								<option value="drop_off_date and drop_off_state">Date & State</option>
									<option value="drop_off_date and des_state">Date & Des_State</option>
									<option value="drop_off_date and des_zone">Date & Des_Zone</option>
								
								<?php } if ($sort=='dv_company_name') {?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name" selected='selected'>Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
								<option value="drop_off_date and drop_off_state">Date & State</option>
									<option value="drop_off_date and des_state">Date & Des_State</option>
									<option value="drop_off_date and des_zone">Date & Des_Zone</option>
																	
								<?php } if ($sort=='drop_off_city') {?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city" selected='selected'>City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
								<option value="drop_off_date and drop_off_state">Date & State</option>
									<option value="drop_off_date and des_state">Date & Des_State</option>
									<option value="drop_off_date and des_zone">Date & Des_Zone</option>
															
								<?php } if ($sort=='drop_off_state') {?>	
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state" selected='selected'>State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
								<option value="drop_off_date and drop_off_state">Date & State</option>
									<option value="drop_off_date and des_state">Date & Des_State</option>
									<option value="drop_off_date and des_zone">Date & Des_Zone</option>
																
								<?php }if ($sort=='drop_off_date'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  selected='selected'>Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date and drop_off_state">Date & State</option>
									<option value="drop_off_date and des_state">Date & Des_State</option>
									<option value="drop_off_date and des_zone">Date & Des_Zone</option>
																		
								<?php }if ($sort=='type_of_truck'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck" selected='selected'>Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date and drop_off_state">Date & State</option>
									<option value="drop_off_date and des_state">Date & Des_State</option>
									<option value="drop_off_date and des_zone">Date & Des_Zone</option>
									
								<?php }if ($sort=='status'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date" >Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status"  selected='selected'>status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date and drop_off_state">Date & State</option>
									<option value="drop_off_date and des_state">Date & Des_State</option>
									<option value="drop_off_date and des_zone">Date & Des_Zone</option>
																	
								<?php }if ($sort=='des_state'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>	
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  >Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state" selected='selected'>Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date and drop_off_state">Date & State</option>
									<option value="drop_off_date and des_state">Date & Des_State</option>
									<option value="drop_off_date and des_zone">Date & Des_Zone</option>
																	
								<?php }if ($sort=='des_zone'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  >Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone" selected='selected'>Des : Zone</option>
									<option value="drop_off_date and drop_off_state">Date & State</option>
									<option value="drop_off_date and des_state">Date & Des_State</option>
									<option value="drop_off_date and des_zone">Date & Des_Zone</option>
																
								<?php }if ($sort=='drop_off_date and drop_off_state'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  >Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date and drop_off_state" selected='selected'>Date & State</option>
									<option value="drop_off_date and des_state">Date & Des_State</option>
									<option value="drop_off_date and des_zone">Date & Des_Zone</option>
														
								<?php }if ($sort=='drop_off_date and des_state'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  >Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date and drop_off_state">Date & State</option>
									<option value="drop_off_date and des_state"selected='selected'>Date & Des_State</option>
									<option value="drop_off_date and des_zone">Date & Des_Zone</option>
																		
								<?php }if ($sort=='drop_off_date and des_zone'){ ?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date"  >Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date and drop_off_state">Date & State</option>
									<option value="drop_off_date and des_state">Date & Des_State</option>
									<option value="drop_off_date and des_zone" selected='selected'>Date & Des_Zone</option>
																
								<?php }} else {?>
									<option value=""></option>	
									<option value="load_no">Load No</option>
									<option value="dv_company_name">Company Name</option>
									<option value="drop_off_city">City</option>
									<option value="drop_off_state">State</option>
									<option value="drop_off_date">Date</option>
									<option value="type_of_truck">Type of Truck</option>
									<option value="status">status</option>
									<option value="des_state">Des : State</option>
									<option value="des_zone">Des : Zone</option>
									<option value="drop_off_date and drop_off_state">Date & State</option>
									<option value="drop_off_date and des_state">Date & Des_State</option>
									<option value="drop_off_date and des_zone">Date & Des_Zone</option>
									
								<?php } ?>
						</select> 
									
					<input type="submit" value="Go" id="Search" />
				 </form>
                 </div>
			     </div>
			</fieldset>
          <form action="<?php echo base_url()?>at/sendmail" method="post">	
			<div style='overflow:scroll;width:1275px;height:450px;border:1pt solid #000;'>
                <table class='Grid' width='1255px' border='1'>
                  <tr>
                        <th nowrap="nowrap" width="40">Select </th>                        
                        <th nowrap="nowrap">Vw</th>
                        <th nowrap="nowrap">Ed</th>
                        <th nowrap="nowrap">Dt</th>
                        <th nowrap="nowrap" width="40">Load No.</th>                
                        <th nowrap="nowrap">Phone Number</th>
                        <th nowrap="nowrap">Name</th>
                        <th nowrap="nowrap">D/V Company Name </th>                        
                        <th nowrap="nowrap">City</th>
						<th nowrap="nowrap">State</th>
                        <th nowrap="nowrap">Date</th>
                        <th nowrap="nowrap">Status </th>                           
                        <th nowrap="nowrap">Des_Zone </th>
                        <th nowrap="nowrap">Date Modified </th>
                        
                            
                  </tr>
<?php
        		  $_rowClass = 'tr_odd';
                foreach($list_at as $row)
                {
                         $load_no = $row->load_no;
						 $cell_phone_num = $row->cell_phone_num;						 
						 $f_name = $row->f_name;
						 $dv_company_name = $row->dv_company_name;
						 $drop_off_city = $row->drop_off_city;
						 $drop_off_state = $row->drop_off_state;
						 $drop_off_date = $row->drop_off_date;
						 $status = $row->status;
						 $rep = $row->rep;
						 $des_state = $row->des_state;
						 $des_zone = $row->des_zone;						 						 
						 $select = $row->select;	
						 $datetime = $row->datetime;					 						 						 				 
?>					
					<tr class="<?php echo $_rowClass ?>"<?php echo GetTrEffects()?>>
						  	<td nowrap="nowrap" align="center"><input type="checkbox" name="checkbox" value="<?php echo $row->at_id?>"></td>                            
                            <td width='5'>
                                <a href="<?php echo base_url() . "at/view_at/" .$row->at_id ?>">
                                	<img src="<?php echo my_url() . "images/icons/view.gif" ?>" style='border:none' />
                                </a>
							</td>
                        	<td width='5'>
                        	<a href="<?php echo base_url() . "at/edit_at/" . $row->at_id ?>">
                            	<img src="<?php echo my_url() . "images/icons/edit.gif" ?>" style='border:none' />
                             </a>
							</td>
                            
                             <td width='5'>
                            	<a href="javascript:void(0)" onclick="confirmDelete(<?php echo $row->at_id ?>);" >
								<img src="<?php echo my_url() . "images/icons/delete.gif" ?>" style='border:none' />
							</a>
						</td>
                            <td nowrap="nowrap" width="40"><?php echo $load_no?></td>                           
                           	<td nowrap="nowrap" ><?php echo $cell_phone_num?></td>                        	
                            <td nowrap="nowrap"><?php echo $f_name?></td>
							<td nowrap="nowrap"><?php echo $dv_company_name?></td>
            	            <td nowrap="nowrap"><b><?php echo $drop_off_city?></b></td>
							<td nowrap="nowrap"><b><?php echo $drop_off_state?></b></td>
							<td nowrap="nowrap"><b><?php echo $drop_off_date?></b></td>
            	            <td nowrap="nowrap"><?php echo $status?></td>     
                	        <td nowrap="nowrap"><?php echo $des_zone?></td>
                            <td nowrap="nowrap"><?php echo $datetime?></td>
                  </tr>
<?php                  
				  if($_rowClass=="tr_odd") $_rowClass="tr_even"; else $_rowClass="tr_odd";     
                 }
?>
                 </table>
                 </div>                                                      <br/>
                  <input type="submit"  value="Send Mail" name="cmdsave">
                 </form>
    		    		
		    
		</div><!---end of ParentContent ---->
    <div class="Footer1">	
                <div class="Footer">Copyright &copy; 2011. All Rights Reserved <br><br>
                 <a href="http://webmartis.com"> <img src="<?php echo my_url();?>/images/wmlink.png"></a>
                 
                </div>                
            </div> <!---end of Footer1 ---->        
        
    </div> <!---end of BodyCover ---->
 
</body>
<?php } ?>
</html>

